﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace JESAI.EventBus.Events
{
    public interface IEvent
    {
        /// <summary>
        /// 事件 Id
        /// </summary>
        string EventId { get; }

        /// <summary>
        /// 事件承载（携带）数据
        /// </summary>
        object Payload { get; }

        /// <summary>
        /// 事件创建时间
        /// </summary>
        DateTime CreatedTime { get; }

        /// <summary>
        /// 取消任务 Token
        /// </summary>
        /// <remarks>用于取消本次消息处理</remarks>
        CancellationToken CancellationToken { get; }

        /// <summary>
        /// 是否允许多次消费
        /// </summary>
        bool AllowMultiConsum { get; }
    }
}
